<template>
	<view class="popup-mask" @click="closePopup" v-if="show">
		
		<view class="cha" @click="cha">
			<img src="static/home/cha.png" alt="">
		</view>
		
		<view>
			<view class="popup-container" @click.stop>
				<view class="popup-container1">
					<view class="avatar">
						<image :src="avatar" />
					</view>
					<text class="name">{{name}}</text>
					<view class="badge-text">
						<img src="static/vip_hz.png" alt="" style="width: 70rpx; height: 70rpx;">
						<text style="font-size: 50rpx; margin: 0 15rpx;">{{badge}}</text>
					</view>
					<view class="view_bk" @click="remake()">
						<uqrcode ref="uqrcode" canvas-id="qrcode" value="测试版本" :options="{ margin: 10}"size='350'
						sizeUnit="rpx" ></uqrcode>
					</view>
				</view>
				<view class="child">
					<img src="static/lg_log.png" alt="" style="width: 300rpx;height:100rpx;padding-bottom: 10rpx;">
				</view>
			</view>
		</view>

	</view>
</template>
<script>
	export default {
		props: {
			show: Boolean,
			name: String,
			badge: String,
			avatar: String
		},
		onReady() {
		},
		methods: {
			closePopup() {
				this.$emit('act', false);
			},
			remake(){
				this.$refs.uqrcode.remake({
				  success: () => {
				   
				  },
				  fail: err => {
					  
				  }
				});
			},
			cha() {
				this.$emit('act', false);
			}
		}
	}
</script>
<style lang="scss">
	.popup-mask {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 99999;
	}
	
	.cha {
		position: absolute;
		margin-left: 80%;
		top: 12%;
		width: 70rpx;
		height: 70rpx;
		z-index: 9999;
	}

	.cha>img {
		width: 100%;
	}

	.popup-container {
		background-color: black;
		width: 700rpx;
		height: 900rpx;
		border-radius: 10rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: relative;
		background-image: url('@/static/vip_bg.png');
		background-size: 100% 100%;
		/* background-repeat: no-repeat; */
		// box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
	}

	/* 平板设备的样式调整 */
	@media screen and (min-width: 500px) {
		.popup-container {
			width: 600rpx;
			height: 800rpx;
		}
	}

	.popup-container1 {
		background-color: rgba(255, 255, 255, 0.5);
		width: 80%;
		height: 80%;
		border-radius: 30rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		position: relative;
		z-index: 5;
	}

	.avatar {
		width: 150rpx;
		height: 150rpx;
		border-radius: 50%;
		position: absolute;
		top: -50rpx;
		// border: 5px solid #1E90FF;
		background-color: white;

		image {
			width: 150rpx;
			height: 150rpx;
			border-radius: 50%;
		}
	}

	.name {
		margin-top: 110rpx;
		font-size: 50rpx;
		text-align: center;
	}

	.badge-text {
		font-size: 16rpx;
		text-align: center;
		color: #fff;
		margin-top: 10px;
		background-color: red;
		padding: 20rpx 20rpx;
		border-radius: 20rpx;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
		width: auto;
		height: 30rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.child {
	  position: absolute;
	  bottom: -27rpx;
	  right: -40rpx;
	}
	.view_bk {
		margin-top: 30rpx;
		width: 400rpx;
		height: 400rpx;
		// background-color: red;
		background-image: url('@/static/vip_bk.png');
		background-size: 100% 100%;
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>